/* eslint-disable max-params */
import { request } from '../request';

export function fetchProcessopetationspec() {
  return request.get<Array<Mes.Processoperationspec>>(`/report/getProcessOperation`);
}

export function fetchLotType() {
  return request.get<Array<Mes.Enumdefvalue>>(`/report/getLotType`);
}

export function fetchPanelType() {
  return request.get<Array<Mes.Enumdefvalue>>(`/report/getPanelType`);
}

export function fetchDailyReportData(
  startTime: string,
  endTime: string,
  areaName: string,
  modelType: string,
  productSpecName: string,
  processoperationName: string,
  lotType: string,
  panelType: string,
  productRequest: string,
  productRequestIn: string
) {
  return request.get<Array<any>>(
    `/report/getDailyReportData?startTime=${startTime}&endTime=${endTime}&areaName=${areaName}&modelType=${modelType}&productSpecName=${productSpecName}&processoperationName=${processoperationName}&lotType=${lotType}&panelType=${panelType}&productRequest=${productRequest}&productRequestIn=${productRequestIn}`
  );
}

export function fetchDailyReportDataV1(
  startTime: string,
  endTime: string,
  areaName: string,
  productSpecName: string,
  processoperationName: string,
  productRequest: string
) {
  return request.get<Array<any>>(
    `/report/getDailyReportDataV1?startTime=${startTime}&endTime=${endTime}&areaName=${areaName}&productSpecName=${productSpecName}&processoperationName=${processoperationName}&productRequest=${productRequest}`
  );
}

export function fetchDailyReportDataV2(
  startTime: string,
  endTime: string,
  areaName: string,
  productSpecName: string,
  processoperationName: string,
  productRequest: string
) {
  return request.get<Array<any>>(
    `/report/getDailyReportDataV2?startTime=${startTime}&endTime=${endTime}&areaName=${areaName}&productSpecName=${productSpecName}&processoperationName=${processoperationName}&productRequest=${productRequest}`
  );
}
export function fetchPlanActData(startTime: string, endTime: string) {
  return request.get<Array<any>>(`/report/getPlanAct?startTime=${startTime}&endTime=${endTime}`);
}

export function fetchLotDataByProductRequest(productrequestname: string) {
  return request.get<Array<any>>(`/report/getLotDataByProductRequest?productrequestname=${productrequestname}`);
}

export function fetchProductUse(startTime: string, endTime: string) {
  return request.get<Array<any>>(`/report/getProudctUse?startTime=${startTime}&endTime=${endTime}`);
}

export function fetchParentLotActByState(
  startTime: string,
  endTime: string,
  productSpecName: string,
  parentLotName: string,
  lotState: string
) {
  return request.get<Array<any>>(
    `/report/getParentLotActByState?startTime=${startTime}&endTime=${endTime}&productSpecName=${productSpecName}&parentLotName=${parentLotName}&lotState=${lotState}`
  );
}

export function fetchEnumvalue(enumname: string) {
  return request.get<Array<any>>(`/report/getEnumvalue?enumname=${enumname} `);
}
